package com.neusoft.approveserver.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.neusoft.approveserver.dto.RespBean;
import com.neusoft.approveserver.entity.Approval;
import com.neusoft.approveserver.mapper.ApprovalMapper;
import com.neusoft.approveserver.service.IApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 机会审批记录表 服务实现类
 * </p>
 *
 * @author victor
 * @since 2021-07-18
 */
@Service
public class ApprovalServiceImpl extends ServiceImpl<ApprovalMapper, Approval> implements IApprovalService {
    @Autowired
    ApprovalMapper approvalMapper;
    @Override
    public RespBean addChanceApproval(Approval approval) {
        RespBean respBean = RespBean.ok(200, "Chance approval added successfully!");
        approvalMapper.insert(approval);
        return respBean;
    }

    @Override
    public RespBean queryAllApproval() {
        List<Approval> approvalList = approvalMapper.selectList(null);
        return RespBean.ok(200,"Search success",approvalList);
    }
}
